Skip to content

EVGAP-02:CRC-specific linkage 证据抽取契约(contract-only,未执行;Track A) - #61

Merged
leezx merged 3 commits into
mainfrom
task_20260805_evgap-02-crc-linkage-contract
Aug 5, 2026
Merged

EVGAP-02:CRC-specific linkage 证据抽取契约(contract-only,未执行;Track A)#61
leezx merged 3 commits into
mainfrom
task_20260805_evgap-02-crc-linkage-contract

Conversation

@leezx

@leezx leezx commented Aug 5, 2026

Copy link
Copy Markdown
Owner

状态

三条阻断已全部接受并修订完毕。 请复审。

阻断 1(接受):D 类检索没有真正进入 search completeness,且 endpoint 覆盖语义未冻结

你指出的两个后果都成立:subgroup pair 可能在未真正检索 D 类时直接落 L3-03L3-05 的「四类均无命中」也可能在 D 类未检索时被错误触发。另外 peer_reviewed_literature 有 PubMed/PMC 两个 endpoint、public_molecular_dataset 有三个,而契约只要求覆盖 source class——执行者可以只查其中一个,结果不可复现。

  • 新增 per_pair_required_class_d_search369 个 pair 全覆盖,每 pair 记录六个字段(class_d_query_expressionclass_d_executed_atclass_d_result_countclass_d_reachableclass_d_source_coverage_refclass_d_search_complete),六个字段同时进入 disposition_columns
  • incomplete_consequence: L3-01——D 类未完成必须落 L3-01,不得落 L3-03L3-05VAL-L18);L3-03L3-05requires_class_d_search_complete: true
  • search_complete_requires_both_levels: true,两级为 target 级 endpoint 覆盖 + pair 级 D 类覆盖
  • coverage_unit: endpoint,每个 source class 加 all_endpoints_required: trueminimum_endpoint_set:PubMed PMC;ClinicalTrials.gov;TCGA GEO HPA。缺任一 endpoint 该 target 全部 pair 落 L3-01VAL-L19

阻断 2(接受):disposition 与 evidence 之间没有稳定引用关系

初稿只有 evidence_row_count,单条 disposition 无法证明自己由哪些 evidence 行支持。而我的测试用两张表列的并集验证条件必填字段——这恰好掩盖了问题。这条批评对测试方法本身比对契约更准。

  • evidence 表新增唯一 evidence_id
  • disposition 表新增 supporting_evidence_refsclass_d_evidence_refsother_cancer_evidence_refs
  • 新增 evidence_reference_requirements,逐规则冻结:
规则 supporting class_d other_cancer
L3-01 必须为空 必须为空 可空(不得伪造)
L3-02 canonical 至少一条 A/B/C 可空 可有但不计入 linkage
L3-02 subgroup 至少一条 A/B/C 至少一条 可有但不计入 linkage
L3-03 至少一条疾病级 CRC 证据 必须为空 可空
L3-04 必须为空 必须为空 至少一条
L3-05 必须为空 必须为空 必须为空(检索 provenance 完整)
  • 新增 VAL-L16(引用 id 必须存在于 evidence 表且 pair_id 一致)、VAL-L17(逐规则引用约束)、VAL-L20evidence_row_count 必须等于三组 refs 去重后总条数)
  • 每个 conditionally_required_columns 块加 table 字段,测试改为逐表检查,不再用并集

阻断 3(接受):PR 不可合并

同步 origin/main0190a73),logs/worklog.md 冲突按时间顺序解决(main 的 12:45 EDT 在前、我的 13:30 在后),断言无残留冲突标记、两侧条目与标题全在。

合并后核验:相对 main只有 5 个文件未混入 PR #60 的 preview 结果grep -c preview = 0),未引入其他无关契约,CI 通过。

一处我自己的操作失误

中途为处理 PR #60 切分支时执行了 git stash -u,把阻断 1/2 的未提交 YAML 改动一并藏入栈,切回后没恢复,导致后续编辑落在未修订版本上、测试报 KeyError。已定位 stash@{0}、丢弃冲突编辑、git stash pop 恢复全部 133 行后重做,无内容丢失。记录在此以免重犯。

本轮变异检验

12 个全部被捕获后精确回滚:把 D 类改为非必需、让 D 类未完成落 L3-03、让 L3-05 不要求 D 类完成、让完整性只要 target 级、覆盖粒度退回 source class、只查 PubMed 就算覆盖、去掉 evidence_id、让 L3-04 可引用 supporting refs、让 subgroup RETAIN 不需 D refs、让 L3-05 可引用证据、把必填列声明到错误的表、删掉 L3-03 的 D refs 为空约束。


这个 PR 是什么

冻结一次证据抽取的范围、来源分层、四类 linkage 判据、求值优先级、检索范围与输出验证,用于解除 PR #58 登记的 EVGAP-02——它阻断 LOCK-03

不执行抽取,不发起任何检索,不执行 Level 01,不解除 EVGAP-01

main 基线 e30a430,5 个文件 +1149/-0Ran 334 tests 全部通过(基线 309 + 新增 25)。

判据取自 Asset-Generation-OS-architecture.md# EVGAP-02 应该具体抽取什么# EVGAP-02 最小结果标准。这是来源文档指定的 Track A,优先级高于 SRCADM-01EVGAP-01(Track B)。


一、与 EVGAP-01 独立,这决定了范围

independent_of: [EVGAP-01, SRCADM-01]blocked_by: [contract_approval]——唯一阻断是本契约自身的审核,获批即可执行。

LOCK-03 问的是「target 为什么与这个 CRC clinical context 有关」,与表面拓扑无关,故不读 surfaceome 参考库、不受其准入状态影响。

因此抽取覆盖全部 369 个 pair,而不是 EVGAP-01 之后可能 eligible 的 22 个。若只覆盖 22 个,本抽取就会依赖尚未准入的 surfaceome 判定结果,既污染来源,也使两条 track 无法并行。

二、核查发现:派生库未获准入是普遍状况

仓库内 logs/chatgpt-review-*.md 中没有任何一条提及过任何本地派生数据库。 PR #59 发现的 surfaceome 问题不是孤例。

Tier 1:原始公开来源,可直接使用

PubMed/PMC、ClinicalTrials.gov、TCGA/GEO/HPA,加已批准的枚举轴(PR #29)。每类都规定了必须记录的 provenance 字段。

依据是 PR #59 审核所作的区分:原始公开来源不是派生数据库,内容可由 source_locator 直接回溯到原始记录,不存在「构建逻辑是否遵守声明」的问题。这一层足以支撑本次抽取,所以本契约获批后即可执行,无需等待任何 admission。

Tier 2:派生本地库一律禁用至各自获准入

ID 数据库 本会服务的类 admission
SRCADM-02 ADCdb B null
SRCADM-03 CRC_journal_whitelist_literature A null
SRCADM-04 CRC_Atlas_fulltext_accession_ledger A null
SRCADM-05 ADC_competitive_landscape_reference B null

后果写明:检索完整性只在 Tier 1 声明范围内成立。 日后某库获准入需另开 PR 扩大范围并重跑,不得静默扩大(VAL-L10)。

三、四类判据,C 类是本契约新增

A CRC human tumor expression:蛋白优先;RNA 可证明 linkage 存在但绝不得替代 LOCK-01,必须标注。测试与 Level 01 契约双向校验

B CRC-specific ADC precedent:CRC 试验/preclinical/cell line/PDO/PDX/动物模型。仅其他癌种 precedent 不算 linkage,降为 metadata_only_holdL3-04),与 #58 一致。

C CRC-specific target-directed modality evidence(新增):naked antibody、CAR-T、bispecific、radioimmunotherapy、immunotoxin、imaging antibody。证明 target 在 CRC 中可接近或可干预,满足 LOCK-03 存在性(该锁只问关联、不问 ADC 疗效),但必须标注 is_adc_efficacy_evidence: falseVAL-L04MF-L02)。

D Context-specific enrichment:疾病级 CRC 证据只支持 canonical context,亚群必须有 D 类证据才能 RETAIN

四、检索范围冻结——本契约最关键的一节

PR #58 判定 no_known_linkage_after_complete_search 不可用,理由是检索范围未闭合。本契约冻结范围,正是使该 outcome 变为可用的前提:范围一旦冻结,「是否完成规定检索」就成为可判定的事实,而不是执行者的自我声明。

  • 每个 target 必须对三类 Tier 1 来源各执行检索
  • 必须记录 query template(target 符号与同义词、CRC 术语、类别特异术语、日期范围)
  • 每次检索必须记录 query_expressionexecuted_atresult_countreachable
  • 来源不可达 → 该 target 判为检索未完成silent_skip_forbidden: true

检索粒度也写明:A/B/C 的疾病级检索按 target 一次(41),D 类按 pair(369)——避免「检索次数」这个数字被误读。

五、五条规则与 32 组合穷举证明

优先级 L3-01L3-02L3-03L3-04L3-05先判检索是否完成——未完成时「没找到」无法与「不存在」区分。

ID 条件 outcome disposition state
L3-01 未完成规定检索 linkage_evidence_missing DEFER hold
L3-02 有 A/B/C 任一 CRC-specific 证据,且 canonical 或亚群有 D 类 linkage_evidence_exists RETAIN active
L3-03 有疾病级证据但亚群无 D 类 linkage_unassessed DEFER hold
L3-04 仅其他癌种 precedent linkage_unassessed DEFER hold
L3-05 完成规定检索且四类均无命中 no_known_linkage_after_complete_search EXCLUDE reactivation-eligible

只有 L3-02 可 RETAIN、只有 L3-05 可 EXCLUDE,测试断言各恰好一条。L3-05 的 EXCLUDE 严格限定为 EXCLUDE_FROM_ACTIVE_POOLis_scientific_disproofis_killedfalse,须六项完整性字段齐备。

测试用参考实现穷举 search_complete × crc_specific × canonical × class_d × other_cancer全部 32 种组合,证明每种恰好命中一条且五条规则均可达——PR #59 阻断 4 的教训,这次一开始就做。

六、本契约有意不给预期结果形状

EVGAP-01 读固定数据集,结果可事先算出并逐项核对(22/19)。EVGAP-02 是发现型检索,事先给这类数字就是把预测冒充成结果——来源文档列为第二种必须避免的混淆。

改为冻结 declared_search_scopesearch_complete_definitionderivation_precedence、provenance 要求与输出验证。测试断言 provided: false,且不得以任何别名偷偷塞入计数(变异检验含此项)。

七、沿用前几轮教训

八、验证

  • Ran 334 tests 通过;scripts/verify_repository_boundary.sh 通过;git diff --check 通过;零 __pycache__
  • 13 个变异全部被捕获后精确回滚:让 RNA 满足 LOCK-01、把 C 类声明为 ADC 疗效证据、让泛癌 precedent 算 linkage、让疾病级证据支撑亚群、L3-03 改判 RETAIN、完整检索排除改判 killed、检索完整性排到优先级最后、允许静默跳过来源、开放 Tier 2、自行填入 SRCADM-02 记录、偷偷加入预测计数、要求未找到证据的行也有 source_ref、范围缩到依赖 LOCK-01 状态。
  • 一处我自己测试的错误已修:初稿断言「除 L3-05 外全部 DEFER」,漏了 L3-02 是 RETAIN 规则;改为逐规则断言并加「恰好一条 RETAIN、恰好一条 EXCLUDE」。

九、授权与不授权

授权:APPROVE 后按本契约执行一次抽取,读取 Tier 1 来源,覆盖全部 369 个 pair。

不授权: 执行 Level 01;解除 EVGAP-01;读取任何 Tier 2 派生库;把任何派生库纳入已批准来源;评估 T2/T7/任何 Gate;新增靶点或 context;任何筛选排序、Tier 划分、资产推荐或实验建议;引入被隔离运行(#53#54)的任何产物。

四条 mandatory_findingsMF-L01 RETAIN 不表示适合 ADC/不表示疗效/不表示治疗窗;MF-L02 C 类不是 ADC 疗效证据;MF-L03 完整性只在 Tier 1 范围内成立;MF-L04 RETAIN 不使 pair 进入 Level 02,EVGAP-01 未解除前 may_advance_to_level_02 恒为 false

十、架构影响

未触碰 src/src/contracts/genmodules/extensions/docs/architecture/AGENTS.mdprompts/;未新增 Gate,未改 45-Gate 拓扑、生命周期、核心对象、envelope、Model 或 Profile。5 个文件全在 docs/tests/logs/。不消耗 8 月月度架构修复额度。

请重点看两点

  1. Tier 1/Tier 2 的划分是否成立——原始公开来源可直接用、派生本地库须各自 admission。以及据此认定本契约获批即可执行(不像 EVGAP-01:target surface localization 抽取契约(contract-only;抽取待 SRCADM-01 授权) #59 需等 admission)是否正确。
  2. C 类作为 linkage 存在性依据是否可接受——CAR-T/bispecific/RIT/immunotoxin/imaging antibody 在 CRC 中的靶向证据,是否足以满足 LOCK-03 的「存在关联」,还是应当降为 metadata。

本 PR 不适用 AGENTS.md「审核豁免」,须经 ChatGPT APPROVE。批准只代表接受抽取边界的冻结并授权执行一次抽取;不批准任何 linkage 判定、不解除 EVGAP-01、不授权执行 Level 01,也不批准任何靶点判定或科学结论。

leezx and others added 3 commits August 5, 2026 12:28
Freezes one evidence-extraction run that would discharge EVGAP-02, the gap that
blocks LOCK-03. Nothing is executed, no search is issued, and Level 01 remains
unauthorised because EVGAP-01 is still open.

This is Track A, which the source document puts ahead of SRCADM-01 and EVGAP-01.
The contract is independent of both: LOCK-03 asks why a target relates to a CRC
clinical context, which has nothing to do with surface topology, so it reads no
surfaceome reference and is unaffected by that database's admission status. Its
only blocker is its own approval. That independence is also why the scope covers
all 369 pairs rather than the 22 that EVGAP-01 might later make eligible -
scoping to 22 would make this run depend on unadmitted surfaceome verdicts and
would stop the two tracks running in parallel.

Governance finding: no review record in the repository mentions any local derived
database at all. The surfaceome admission problem found in PR #59 is the general
case, not an exception. Sources are therefore tiered. Tier 1 primary public
sources - PubMed/PMC, ClinicalTrials.gov, TCGA/GEO/HPA, plus the approved
enumeration axis - are usable directly, on the distinction the reviewer drew in
PR #59: a primary source is not a derived database and its content traces
straight back to the original record. Tier 1 alone can carry this extraction, so
the contract is executable on approval. Tier 2 derived local databases are barred
until each is admitted, and four pending admissions are registered with null
record refs.

Four linkage classes are frozen. RNA may establish linkage existence but never
satisfies LOCK-01, checked against the Level 01 contract in both directions.
Other-cancer-only precedent is metadata and holds. Class C, new here at the source
document's request, admits naked antibody, CAR-T, bispecific, radioimmunotherapy,
immunotoxin and imaging antibody as proof that the target is reachable in CRC,
while requiring is_adc_efficacy_evidence false on every such row. Disease-level
CRC evidence supports the canonical context only; a subgroup needs class D.

The declared search scope is the load-bearing part. PR #58 barred
no_known_linkage_after_complete_search because the search scope was not closed;
freezing it is what makes that outcome available, turning "was the required search
completed" into a decidable fact rather than an executor's self-assertion. An
unreachable source marks that target's search incomplete and silent skipping is
forbidden.

Precedence is frozen with completeness first, since "not found" cannot be
distinguished from "does not exist" before the search closes. Exactly one rule may
retain and exactly one may exclude, and the exclusion is EXCLUDE_FROM_ACTIVE_POOL
with is_scientific_disproof and is_killed false. A reference implementation
exhausts all 32 combinations of the five conditions and proves each resolves to
exactly one reachable rule.

No result shape is predicted, deliberately. EVGAP-01 reads a pinned dataset so its
counts can be computed in advance; EVGAP-02 discovers evidence, and quoting counts
now would pass a prediction off as a result, which the source document names as the
second confusion to avoid.

334 tests pass. Thirteen mutations caught and rolled back exactly. One error in my
own test was caught and fixed: it asserted every rule but L3-05 defers, missing
that L3-02 is the retain rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…2-crc-linkage-contract

# Conflicts:
#	logs/worklog.md
All three blockers accepted.

Blocker 1: class D never entered search completeness, and endpoint coverage was
left to the executor. The contract said A/B/C are searched per target and D is
assessed per pair, but search_complete_definition only required the three
source classes per target. Both consequences the reviewer named are real: a
subgroup pair could land on L3-03 without D ever being searched, and L3-05's
"no class hit" could fire with D unsearched. Separately, peer_reviewed_literature
has two endpoints and public_molecular_dataset three, while the contract only
demanded source-class coverage, so an executor could query one and stop.
per_pair_required_class_d_search now covers all 369 pairs with six recorded
fields that also appear in the disposition table, and an incomplete D search
forces L3-01 rather than L3-03 or L3-05. Completeness now requires both levels,
coverage_unit is endpoint, and every source class declares
all_endpoints_required with an explicit minimum_endpoint_set.

Blocker 2: nothing tied a disposition row to the evidence rows behind it. With
only evidence_row_count, an L3-02 retain could not answer which A/B/C evidence
supported it, which D evidence carried a subgroup, or whether other-cancer
precedent was present without being counted as linkage. Worse, my test validated
the conditionally required columns against the union of both tables, which is
precisely what masked this. Evidence rows now carry a unique evidence_id,
dispositions carry supporting, class-D and other-cancer reference lists, and
evidence_reference_requirements freezes per rule what must and must not be cited,
with L3-02 split by context kind. Each conditional block now names its table and
the test checks per table instead of the union.

Blocker 3: synced origin/main and resolved logs/worklog.md chronologically, with
main's 12:45 entry before mine at 13:30. Verified afterwards that the diff against
main is still exactly five files, that none of PR #60's preview output leaked in,
and that no unrelated contract came with it.

One operational mistake of my own, caught and repaired: switching branches to
handle PR #60 I ran git stash -u, which swept the uncommitted blocker 1 and 2 YAML
edits into the stash, and I did not restore them on returning, so later edits
landed on the unrevised file and the tests raised KeyError. Located stash@{0},
discarded the conflicting edit, popped all 133 lines back and redid the work with
nothing lost.

338 tests pass. Twelve mutations caught and rolled back exactly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant